#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

using namespace std;

int main()
{
    string s;
    char a;
    cin >> s >> a;
    for (char& c : s)
    {
        if (c == a)
            c = '#';
    }
    cout << s << endl;
    return 0;
}